Source Plugin SDK
 
The following functions are for Source plugins only.

NOTES:
The SAMURIZE_PLUGIN_CHAR and SAMURIZE_PLUGIN_INT types are defined as

#define SAMURIZE_PLUGIN_CHAR extern "C" __declspec(dllexport) char* __stdcall
#define SAMURIZE_PLUGIN_INT extern "C" __declspec(dllexport) int __stdcall


In Delphi they are simply the PChar and Integer types.

Function List
SAMURIZE_PLUGIN_CHAR getparam(char* func)
 
SOURCE PLUGINS ONLY

The getparam() function should return a list of the parameters that the passed function requires.

Parameters:
  • func - the name of the function Samurize needs to know the parameters for.
Return Value:
A list of parameters delimited by '|' characters. Note that there needs to be a final '|' after the last parameter.
Appending '=' and then a value to the end of a parameter indicates the default value for that parameter.
eg. "Param1|Param2|Param3=SomeDefaultValue|"
 
SAMURIZE_PLUGIN_INT configure()
 
SOURCE PLUGINS ONLY

configure() is called when the user clicks on the "Configure Plugin..." button in Samurize.
You can display a popup dialog with global settings for your plugin (eg. a box prompting for your location for a weather plugin). These settings will be applied for all meters that use this source plugin.
Note that it is your responsibility to save these settings to the registry/settings file/whatever - they aren't stored by Samurize anywhere.

Return Value:
This function should always return 0.
 
SAMURIZE_PLUGIN_INT source_configure(int id, char* func)
 
SOURCE PLUGINS ONLY

source_configure() is called when the user clicks on the "Configure..." button in Samurize.
You can display some kind of popup window that allows users to specify various display settings for this source plugin. Note that you need to store the settings for each meter individually for saving later on.
This function is optional - if it is not provided, you will not be able to specify settings on a meter-by-meter basis.

Parameters:
  • id - the unique ID of the meter being configured (that your plugin assigned to the meter as the return value of dllstartup)
  • func - the name of the function this meter calls from the plugin
Return Value:
This function should always return 0.
 
SAMURIZE_PLUGIN_INT src_load_settings(int id, char* inifile, char* section)
 
SOURCE PLUGINS ONLY

src_load_settings() is called when the config is loaded from file in the config editor or the clients. Your plugin should load its settings from the given section of the specified config file.

Parameters:
  • id - the unique ID assigned to the meter by the dllstartup() function
  • inifile - the full path to the config file
  • section - the section of the config file where the values are listed
Return Value:
This function should always return 0.
 
SAMURIZE_PLUGIN_INT src_save_settings(int id, char* inifile, char* section)
 
SOURCE PLUGINS ONLY

src_save_settings() is called when the config is being saved by the config editor. Your plugin should save its settings to the given section of the specified config file.

Parameters:
  • id - the unique ID assigned to the meter by the dllstartup() function
  • inifile - the full path to the config file
  • section - the section of the config file where the values should be saved
SAMURIZE_PLUGIN_CHAR icon()
 
SOURCE PLUGINS ONLY

The icon() function should return a fully qualified file name for the icon you would like samurize to use in the config editor

Parameters: none Return Value:
A fully qualified location of the icon you want to use for example c:\program files\samurize\icon.ico